﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="CensoUI.aspx.cs" Inherits="GAIA_IU.CensoUI" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <script src="Scripts/jquery-ui-autocomplete.js" type="text/javascript"></script>
    <script src="Scripts/jquery.select-to-autocomplete.min.js" type="text/javascript"></script>
    <script src="Scripts/formulas.js" type="text/javascript"></script>
    <script charset="utf-8" type="text/javascript">
        (function ($) {
            $(function () {
                $('#selectEspecies0').selectToAutocomplete();

            });

        })(jQuery);

</script>
    <style media="screen" type="text/css">
        
        .ui-autocomplete {
        padding: 0;
        list-style: none;
        background-color: #fff;
        width: 218px;
        border: 1px solid #B0BECA;
        max-height: 350px;
        overflow-y: scroll;
        }
        .ui-autocomplete .ui-menu-item a {
        border-top: 1px solid #B0BECA;
        display: block;
        padding: 4px 6px;
        color: #353D44;
        cursor: pointer;
        }
        .ui-autocomplete .ui-menu-item:first-child a {
        border-top: none;
        }
        .ui-autocomplete .ui-menu-item a.ui-state-hover {
        background-color: #D5E5F4;
        color: #161A1C;
        }
        /**/
        input.ui-autocomplete-input{width:120px;}
    </style>	
    <h2>
        Estudio de Terreno
    </h2>
    <p>
        Ingrese la informaci&oacute;n solicitada.
    </p>
    
    <asp:Label ID="aviso_label" runat="server" Text=""></asp:Label>     
    
    <span class="failureNotification">
                <asp:Literal ID="FailureText" runat="server"></asp:Literal>
            </span>
            <asp:ValidationSummary ID="TerrenoValidationSummary" runat="server" CssClass="failureNotification" 
                 ValidationGroup="TerrenoValidationGroup"/>
    
    <div class="formMantenimiento">
        <fieldset class="login">
               <legend>Buscar finca</legend>
                <asp:DropDownList ID="tipo_busqueda" runat="server">
                    <asp:ListItem Value="nombre">Nombre</asp:ListItem>
                </asp:DropDownList>
                <asp:TextBox ID="txt_busqueda" runat="server"></asp:TextBox>
            &nbsp;
                <asp:Button ID="btn_busqueda" runat="server" Text="Buscar" 
                    onclick="btn_busqueda_Click" />
                
                  
            <p class="submitButton">
                &nbsp;</p>

                <div id="estudio">
                    <div>
                        <asp:GridView ID="GridView_Terrenos" runat="server" AutoGenerateColumns="False" 
                            DataKeyNames="Id,Nombre" GridLines="None" 
                            AllowPaging="True" 
                            OnPageIndexChanging="gridView_PageIndexChanging" 
                            onselectedindexchanged="GridView_Terrenos_SelectedIndexChanged" 
                            CssClass="gridView" Width="100%">
                            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                            <Columns>
                                <asp:BoundField DataField="Id" HeaderText="Id" 
                                    SortExpression="Id" />
                                <asp:BoundField DataField="Nombre" HeaderText="Nombre" 
                                    SortExpression="Nombre" />
                                <asp:CommandField AccessibleHeaderText="Seleccionar" 
                                    ShowSelectButton="True" SelectText="Seleccionar Finca" />
                            </Columns>
                            <PagerStyle BackColor="#2F6590" ForeColor="White" HorizontalAlign="Center" />
                            <SelectedRowStyle BackColor="#65C0ED" Font-Bold="True" ForeColor="#006699" />
                            <HeaderStyle BackColor="#808080" Font-Bold="False" ForeColor="White" HorizontalAlign="Left"/>
                            <EditRowStyle BackColor="#999999" />
                            <AlternatingRowStyle BackColor="White" ForeColor="#0B4B81" />
                        </asp:GridView> 
                    </div>

                    <div>
                        <asp:GridView ID="GridView_Parcelas" runat="server" AutoGenerateColumns="False" 
                            DataKeyNames="Id,Nombre,Tamano" GridLines="None" 
                            onselectedindexchanged="GridView_Parcelas_SelectedIndexChanged" 
                            CssClass="gridView" Width="100%">
                            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                            <Columns>
                                <asp:BoundField DataField="Id" HeaderText="Id" 
                                    SortExpression="Id" />
                                <asp:BoundField DataField="Nombre" HeaderText="Nombre" 
                                    SortExpression="Nombre" />
                                <asp:BoundField DataField="Tamano" HeaderText="Tamaño" 
                                    SortExpression="Tamano" />
                                <asp:CommandField AccessibleHeaderText="Seleccionar" 
                                    ShowSelectButton="True" SelectText="Seleccionar Parcela" />
                            </Columns>
                            <PagerStyle BackColor="#2F6590" ForeColor="White" HorizontalAlign="Center" />
                            <SelectedRowStyle BackColor="#65C0ED" Font-Bold="True" ForeColor="#006699" />
                            <HeaderStyle BackColor="#808080" Font-Bold="False" ForeColor="White" HorizontalAlign="Left"/>
                            <EditRowStyle BackColor="#999999" />
                            <AlternatingRowStyle BackColor="White" ForeColor="#0B4B81" />
                        </asp:GridView> 
                    </div>

                </div>

            </fieldset>   
            <p class="submitButton">
                &nbsp;</p>

        
    </div>

    <div class="menuMantenimiento">
        <fieldset class="login">
            <legend>Opciones:</legend>
            <ul>
                <li><a href="act_terrenos.aspx">Actualizar Finca</a></li>
            </ul>
        </fieldset>
    </div>

    <div id="Contenedorparcelas" style="clear:both; margin-top:10px;">
        <fieldset class="login">
            <legend>Ingreso de Estudio</legend>
                <input type="hidden" value="1" name="cant_especies"/>
                <div id="parcelas">
                <div id="0">
                   <asp:Repeater ID="rptPlants" runat="server">
                        <HeaderTemplate><select id="selectEspecies0"autofocus="autofocus" autocorrect="off" autocomplete="off" name="especies[0].id" style="width:240px"></HeaderTemplate>
                        <FooterTemplate></select></FooterTemplate>
                        <ItemTemplate>
                            <option value="<%# DataBinder.Eval(Container.DataItem, "Id")%>" value_form="<%# DataBinder.Eval(Container.DataItem, "NumFormula")%>"><%# DataBinder.Eval(Container.DataItem, "NomCien")%>/<%# DataBinder.Eval(Container.DataItem, "NomPop")%>- <%# DataBinder.Eval(Container.DataItem, "Id")%></option>
                        </ItemTemplate>
                    </asp:Repeater>
                   <input title="DAP" id="0" class="dap" name="especies[0].dap" type="text" placeholder="DAP" style="width:50px" alt="DAP"/>
                   <input title="HC" id="0" class="hc" name="especies[0].hc" type="text" placeholder="HC" style="width:50px" alt="HC"/>
                   <input title="lambertN" id="lambertN" class="lambertN" name="especies[0].lambertN" type="text"  placeholder="LambertN" style="width:80px" alt="LambertN"/>
                   <input title="lambertE" id="lambertE" class="lambertE" name="especies[0].lambertE" type="text" placeholder="LambertE" style="width:80px" alt="LambertE"/>
                   <input title="Volumen" name="especies[0].calculo" type="text" placeholder="Volumen" style="width:80px" readonly="readonly" alt="Volumen"/>
                   <input title="Area" name="especies[0].areabasal" type="text" placeholder="AreaBasal" style="width:80px" readonly="readonly" alt="Area"/>
                   <a href="#" onClick="Calcular('0',event)">[Calcular]</a>
                   <input name="especies[0].num_formula" type="hidden" value="" />
                </div>
                
                </div> 
                <label>Agregar especie <a href="#" id="agregaEspecie">[+]</a></label>  <br /><br />  
                <input type="button" onclick="CalcularAll(event)" value="Calcular todos"/>
        </fieldset>
            <p class="submitButton">  
                <asp:Button ID="btn_salvar" runat="server" Text="Salvar" 
                    onclick="btn_salvar_Click" 
                    ValidationGroup="TerrenoValidationGroup" Enabled="False"/>
            </p>
            <p class="submitButton">&nbsp;</p>
        </div>

</asp:Content>
